/**
 * 您的公司.com
 * Copyright (c) 2018-2018 All Rights Reserved.
 */
package com.mei.demo.Thread;

/**
 * 实现 Runnable 实现多线程
 *
 * @author mei.xiaoliang@qq.com
 */
public class Demo2 {

    public static void main(String[] args) {
        Thread t1 = new Thread(new threadNew("线程 1"));
        Thread t2 = new Thread(new threadNew("线程 2"));
        Thread t3 = new Thread(new threadNew("线程 3"));
        t1.start();
        t2.start();
        t3.start();
    }
}

class threadNew implements Runnable {

    private String name;

    public threadNew(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(name + " 走你: i=" + i);
        }
    }

}